Add missing fields to Team struct#295
Merged
Merged
Conversation
The Team struct was missing several fields that the API returns: GraphQLID, DefaultMemberRole, MembersCanCreatePipelines, MembersCanCreateSuites, MembersCanCreateRegistries, MembersCanDestroyRegistries, and MembersCanDestroyPackages. Without these fields, API consumers performing read-modify-write updates (eg GET team, modify a field, PATCH team) would silently reset these values to their zero values. In particular, MembersCanCreatePipelines would always be sent as false on updates because the current team state could never be read into the struct.
mcncl
reviewed
Apr 8, 2026
Comment on lines
+30
to
+33
| MembersCanCreateSuites bool `json:"members_can_create_suites"` | ||
| MembersCanCreateRegistries bool `json:"members_can_create_registries"` | ||
| MembersCanDestroyRegistries bool `json:"members_can_destroy_registries"` | ||
| MembersCanDestroyPackages bool `json:"members_can_destroy_packages"` |
Contributor
There was a problem hiding this comment.
Don't these also need to be added to the CreateTeam struct?
Contributor
|
We're not checking on the |
Contributor
|
|
Address review feedback: ensure ListForUser, CreateTeam, and UpdateTeam tests also verify the new fields (GraphQLID, DefaultMemberRole, MembersCanCreatePipelines, etc.) are correctly deserialized in API responses.
The API accepts members_can_create_suites, members_can_create_registries, members_can_destroy_registries, and members_can_destroy_packages on create and update, but they were missing from CreateTeam. Without them, update operations would silently reset these permissions to false.
mcncl
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Teamstruct is missing several fields that the Buildkite API returns in its team responses (presenter):GraphQLIDDefaultMemberRoleMembersCanCreatePipelinesMembersCanCreateSuitesMembersCanCreateRegistriesMembersCanDestroyRegistriesMembersCanDestroyPackagesThese fields are silently dropped during JSON deserialization when reading a team from the API.
Impact
This causes a data-loss bug for any consumer performing a read-modify-write update pattern (GET team → modify a field → PATCH team). Since the
CreateTeamstruct used for updates includesMembersCanCreatePipelinesas a non-omitemptybool, the PATCH request will always sendmembers_can_create_pipelines: false, resetting the value regardless of the team's actual setting.This directly affects buildkite/cli#727 which adds a
bk team updatecommand using this pattern.Changes
TeamstructTestTeamsService_ListandTestTeamsService_GetTeamto verify the new fields deserialize correctly